<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/locale/easyui-lang-zh_CN.js"></script>
		<script type="text/javascript">
			$(function() {
				parent.$.messager.progress('close');
				
				$('#form').form({
					url : '<%=request.getContextPath() %>/user/saveUser',
					success : function(data) {
						parent.$.messager.progress('close');
						var data = $.parseJSON(data);
						if (data.result) {
							parent.$.modalDialog.handler.userGrid.datagrid('reload');
							parent.$.modalDialog.handler.dialog('close');
						} else {
							parent.$.messager.alert('提示', data['message'], 'info');
						}
					}
				});
			});
		</script>
	</head>
	<div class="easyui-layout" data-options="fit:true,border:false">
		<div data-options="region:'center',border:false" title="" style="overflow: hidden;">
			<form id="form" method="post" >
				<table class="formtab">
					<tr>
						<th>用户名</th>
						<td><input name="username" type="text" placeholder="请输入登陆用户名" 
								   data-options="prompt:'请输入6~20位英文、数字、下划线组合。',required:'true',validType:'isEasy[]'"
								   class="easyui-validatebox"></td>
					</tr>
					<tr>
						<th>密码</th>
						<td>
							<input name="pwd" type="password" id="pwd" class="easyui-validatebox" data-options="required:true" validType="isEasy[]">
						</td>
					</tr>
					<tr>
						<th>重复密码</th>
						<td>
							<input name="password" type="password" class="easyui-validatebox" data-options="required:true" validType="equals['#pwd']">
						</td>
					</tr>
					<tr>
						<th>姓名</th>
						<td>
							<input name="nickname" type="text" data-options="required:true" class="easyui-validatebox" maxlength="30">
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</html>
